package com.ruoyi.project.system.stream.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.stream.mapper.VideoStreamMapper;
import com.ruoyi.project.system.stream.domain.VideoStream;
import com.ruoyi.project.system.stream.service.IVideoStreamService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 视频流Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-11
 */
@Service
public class VideoStreamServiceImpl implements IVideoStreamService 
{
    @Autowired
    private VideoStreamMapper videoStreamMapper;

    /**
     * 查询视频流
     * 
     * @param streamId 视频流主键
     * @return 视频流
     */
    @Override
    public VideoStream selectVideoStreamByStreamId(Long streamId)
    {
        return videoStreamMapper.selectVideoStreamByStreamId(streamId);
    }

    /**
     * 查询视频流列表
     * 
     * @param videoStream 视频流
     * @return 视频流
     */
    @Override
    public List<VideoStream> selectVideoStreamList(VideoStream videoStream)
    {
        return videoStreamMapper.selectVideoStreamList(videoStream);
    }

    /**
     * 新增视频流
     * 
     * @param videoStream 视频流
     * @return 结果
     */
    @Override
    public int insertVideoStream(VideoStream videoStream)
    {
        videoStream.setCreateTime(DateUtils.getNowDate());
        return videoStreamMapper.insertVideoStream(videoStream);
    }

    /**
     * 修改视频流
     * 
     * @param videoStream 视频流
     * @return 结果
     */
    @Override
    public int updateVideoStream(VideoStream videoStream)
    {
        videoStream.setUpdateTime(DateUtils.getNowDate());
        return videoStreamMapper.updateVideoStream(videoStream);
    }

    /**
     * 批量删除视频流
     * 
     * @param streamIds 需要删除的视频流主键
     * @return 结果
     */
    @Override
    public int deleteVideoStreamByStreamIds(String streamIds)
    {
        return videoStreamMapper.deleteVideoStreamByStreamIds(Convert.toStrArray(streamIds));
    }

    /**
     * 删除视频流信息
     * 
     * @param streamId 视频流主键
     * @return 结果
     */
    @Override
    public int deleteVideoStreamByStreamId(Long streamId)
    {
        return videoStreamMapper.deleteVideoStreamByStreamId(streamId);
    }
}
